import { createRouter, createWebHistory } from 'vue-router'
import MainLayout from '../layouts/MainLayout.vue'

const routes = [
  {
    path: '/',
    component: MainLayout,
    children: [
      {
        path: '',
        redirect: '/payment/list'
      },
      {
        path: 'payment/list',
        component: () => import('../views/payment/PaymentList.vue')
      },
      {
        path: 'payment/create',
        component: () => import('../views/payment/PaymentCreate.vue')
      },
      {
        path: 'payment/detail/:orderNo',
        component: () => import('../views/payment/PaymentDetail.vue')
      },
      {
        path: 'payment/pay/:orderNo',
        component: () => import('../views/payment/PaymentPage.vue')
      },
      {
        path: 'refund/list',
        component: () => import('../views/refund/RefundList.vue')
      },
      {
        path: 'refund/create',
        component: () => import('../views/refund/RefundCreate.vue')
      },
      {
        path: 'refund/detail/:refundNo',
        component: () => import('../views/refund/RefundDetail.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 